Learn PySpark by Pramod Singh

Learn PySpark by Pramod Singh

Author:Pramod Singh
Language: eng
Format: epub
ISBN: 9781484249611
Publisher: Apress


[Out]:

Min-Max Scaling

Min-max scaling is another version of standard scaling, as it allows you to rescale the feature values between specific limits (mostly, between 0 and 1). You can also rescale the values between 0 and 1, using min-max scaling.[In]: from pyspark.ml.feature import MinMaxScaler

[In]: mm_scaler = MinMaxScaler(inputCol="features", outputCol="mm_scaled_features")

[In]: mm_scaler_model = mm_scaler.fit(df_new)

[In]: rescaled_df = mm_scaler_model.transform(df_new)

[In]: rescaled_df.select("features", "mm_scaled_features").show()

[Out]:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.